﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="order_list.aspx.cs" Inherits="backstage_order_list" %>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>订单列表</title>
    <link href="css/skin.css" rel="stylesheet" type="text/css" />
</head>

<script type="text/javascript" src="js/main.js"></script>

<script type="text/javascript" src="js/jquery.min.js"></script>

<script type="text/javascript" src="js/jquery.js"></script>

<script language="javascript" type="text/javascript" src="/My97DatePicker/WdatePicker.js"
    charset="utf-8"></script>

<body class="body">
    <table class="main" cellpadding="0" cellspacing="0">
        <tr>
            <td class="td_left_top">
                <img alt="" src="images/left-top-right.gif" /></td>
            <td class="td_middle_top">
                <div class="left_topbg">
                    <div class="titlebt">
                        订单列表</div>
                </div>
            </td>
            <td class="td_right_top">
                <img alt="" src="images/nav-right-bg.gif" /></td>
        </tr>
        <tr>
            <td class="td_left_middle">
            </td>
            <td class="td_middle_middle">
                <div class="maincontent">
                    <label>
                        查找：</label>
                    <select id="selectOrder" name="t">
                        <option value="orderNo" selected="selected">订单编号</option>
                        <option value="userName">用户名</option>
                    </select>
                    <input id="txtKeyWord" type="text" value="<%=kw %>" />
                    &nbsp;&nbsp;开始日期：<input id="txtStartDate" type="text" onfocus="new WdatePicker(this,'%Y-%M-%D',true,'default')"
                        onpaste="return false" style="ime-mode: disabled" value="<%=sd %>" />&nbsp;&nbsp;结束日期：<input
                            id="txtEndDate" type="text" onfocus="new WdatePicker(this,'%Y-%M-%D',true,'default')"
                            onpaste="return false" style="ime-mode: disabled" value="<%=ed %>" />
                    <input id="btnSearch" type="button" class="formButton" value="搜  索" onclick="keywordSearch('/backstage/order_list.aspx');" />
                    <br />
                    <label>
                        订单状态：</label>
                    <select id="selectOrderStatus" onchange="SetOrderStatus();">
                        <option selected="selected" value="0">所有订单</option>
                        <option value="os=0">未确认</option>
                        <option value="os=1">已确认</option>
                        <option value="os=2">已取消</option>
                        <option value="os=3">无效</option>
                        <option value="os=4">退货</option>
                    </select>
                    &nbsp;&nbsp;&nbsp;&nbsp;
                    <label>
                        支付状态：</label>
                    <select id="selectPayStatus" onchange="SetOrderStatus();">
                        <option selected="selected" value="0">所有订单</option>
                        <option value="pss=0">未支付</option>
                        <option value="pss=1">已支付</option>
                    </select>
                    &nbsp;&nbsp;&nbsp;&nbsp;
                    <label>
                        配送状态：</label>
                    <select id="selectDeliveryStatus" onchange="SetOrderStatus();">
                        <option selected="selected" value="0">所有订单</option>
                        <option value="ds=0">未发货</option>
                        <option value="ds=1">已发货</option>
                        <option value="ds=2">已收货</option>
                    </select>
                    &nbsp;&nbsp;&nbsp;&nbsp;
                    <label>
                        每页显示：</label>
                    <select id="selectPageSize" name="ps" onchange="SetPageSize();">
                        <option value="10">10</option>
                        <option value="20" selected="selected">20</option>
                        <option value="50">50</option>
                        <option value="100">100</option>
                    </select>
                    &nbsp;&nbsp;<input id="btnPostscriptSet" type="button" class="formButton" value="附言设置"
                        onclick="location.href='order_postscript_set.aspx';" />
                    <form id="form1" runat="server">
                        <asp:Button ID="btnExport" runat="server" Text="导出Excel" EnableViewState="false"
                            CssClass="formButton" OnClick="btnExport_Click" />
                        <table cellpadding="0" cellspacing="0">
                            <tr class="tr_title">
                                <td>
                                    <input name="chkall" value="1" type="checkbox" onclick="CheckAllOrder(this,'Item')"
                                        title="全选/反选" />
                                </td>
                                <td>
                                    <span onclick="SetOrder('orderNo');">订单编号</span></td>
                                <td>
                                    <span onclick="SetOrder('userName');">用户名</span></td>
                                <td>
                                    <span onclick="SetOrder('orderTotal');">订单金额</span></td>
                                <td>
                                    <span onclick="SetOrder('orderStatus');">订单状态</span></td>
                                <td>
                                    <span onclick="SetOrder('payStatus');">支付状态</span></td>
                                <td>
                                    <span onclick="SetOrder('deliveryStatus');">配送状态</span></td>
                                <td>
                                    <span onclick="SetOrder('payment');">支付方式</span></td>
                                <td>
                                    <span onclick="SetOrder('deliveryWay');">配送方式</span></td>
                                <td>
                                    <span onclick="SetOrder('createTime');">下单时间</span></td>
                                <td>
                                    操作</td>
                            </tr>
                            <asp:Repeater ID="rptOrder" runat="server">
                                <ItemTemplate>
                                    <tbody>
                                        <tr>
                                            <td>
                                                <input id='cb<%# Eval("id") %>' name="Item" type="checkbox" onclick="ShowOrderModify();"
                                                    value='<%# Eval("id") %>' /></td>
                                            <td>
                                                <a href="order.aspx?id=<%# Eval("id") %>&orderNo=<%# Eval("orderNo") %>">
                                                    <%# Eval("orderNo")%>
                                                </a>
                                            </td>
                                            <td>
                                                <%# Eval("userName")%>
                                            </td>
                                            <td>
                                                <%# String.Format("{0:C}", Eval("orderTotal"))%>
                                            </td>
                                            <td>
                                                <%# GetOrderStatus(Eval("orderStatus")) %>
                                            </td>
                                            <td>
                                                <%# Convert.ToInt32(Eval("payStatus"))==0?"未支付":"已支付"%>
                                            </td>
                                            <td>
                                                <%# GetDeliveryStatus(Eval("deliveryStatus"))%>
                                            </td>
                                            <td>
                                                <%# Eval("payment")%>
                                            </td>
                                            <td>
                                                <%# Eval("deliveryWay") %>
                                            </td>
                                            <td>
                                                <%# Eval("createTime")%>
                                            </td>
                                            <td>
                                                <a href="order.aspx?id=<%# Eval("id") %>&orderNo=<%# Eval("orderNo") %>">
                                                    <img src="images/edt.gif" alt="编辑" />编辑</a>
                                            </td>
                                        </tr>
                                    </tbody>
                                </ItemTemplate>
                                <FooterTemplate>
                                    <tr>
                                        <td colspan="11" style="text-align: center;">
                                            <label id="lblEmpty" style='display: <%# rptOrder.Items.Count==0?"block":"none"%>;
                                                color: Red;'>
                                                没有找到任何记录</label>
                                        </td>
                                    </tr>
                                </FooterTemplate>
                            </asp:Repeater>
                            <tr>
                                <td colspan="11">
                                    <%Response.Write(OrderSumTotal()); %>
                                </td>
                            </tr>
                        </table>
                        <asp:Button ID="btnBulkModify" runat="server" Text="批量修改" EnableViewState="false"
                            CssClass="formButton" OnClientClick="return confirm('确定要批量修改所选订单吗？');" OnClick="btnBulkModify_Click" />
                        <% Response.Write((new Web.Old_App_Code.PageListNo()).DisplayPage(total, pageSize, pageIndex)); %>
                    </form>
                    提示：勾选订单可以进行批量修改，包括(订单状态，支付状态，配送状态)。
                </div>
            </td>
            <td class="td_right_middle">
            </td>
        </tr>
        <tr>
            <td class="td_left_bottom">
                <img alt="" src="images/buttom_left2.gif" />
            </td>
            <td class="td_middle_bottom">
                <img alt="" src="images/buttom_bgs.gif" />
            </td>
            <td class="td_right_bottom">
                <img alt="" src="images/buttom_right2.gif" />
            </td>
        </tr>
    </table>
</body>
</html>
